package com.aeasycredit.credit.tuef.dto;

import java.util.Objects;

import org.apache.commons.lang3.StringUtils;

/**
 * 信贷报告结果body信息
 * @author Duke.du
 *
 */
public class CreditReportEnquiryResultBodyDto extends CommonResultBodyDto {

    /** Return Credit report */
    private byte[] fileContent;
    
    /** File Name */
    private String fileName;
    
    /** Return Report raw data in tuef format */
    private String dataContent;
    
    public byte[] getFileContent() {
        return fileContent;
    }

    public void setFileContent(byte[] fileContent) {
        this.fileContent = fileContent;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getDataContent() {
        return dataContent;
    }

    public void setDataContent(String dataContent) {
        this.dataContent = dataContent;
    }

    @Override
    public String toString() {
        
        StringBuilder builder = new StringBuilder();
        builder.append(this.getClass().getSimpleName()).append("[");
        builder.append("reqMsgId=").append(this.getReqMsgId()).append(",");
        builder.append("rspMsgId=").append(this.getRspMsgId()).append(",");
        builder.append("returnCode=").append(this.getReturnCode()).append(",");
        String returnDesc = this.getReturnDesc();
        if (StringUtils.startsWith(returnDesc, "TUEF")) {
            builder.append("returnDesc=[string length:").append(this.getReturnDesc().length()).append("]");
        } else {
            builder.append("returnDesc=").append(this.getReturnDesc()).append(",");
        }
        
        builder.append("fileName=").append(this.getFileName()).append(",");
        if (Objects.nonNull(fileContent)) {
            builder.append("fileContent=[byte length:").append(fileContent.length).append("],");
        }
        if (Objects.nonNull(dataContent)) {
            builder.append("dataContent=[string length:").append(dataContent.length()).append("]");
        }
        builder.append("]");
        return builder.toString();
    }
}
